#include "ISO8583_lib.h"
#include "ISO8583CustomPay.h"

using namespace suxw;

ISO8583CustomPay::ISO8583CustomPay() : ISO8583()
{
}

bool ISO8583CustomPay::init8583()
{
    m_szFieldManager[0] = new BcdFieldManager(4, FIXED, LEFT, '\0');
    m_szFieldManager[1] = new HexFieldManager(4, FIXED, LEFT, '\0'); //bitmap need special manager
    m_szFieldManager[2] = new BcdFieldManager(19, LLVAR, LEFT, '\0');
    m_szFieldManager[3] = new BcdFieldManager(6, FIXED, RIGHT, '\0');
    m_szFieldManager[4] = new BcdFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[5] = new BcdFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[6] = new BcdFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[7] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[8] = new BcdFieldManager(8, FIXED, RIGHT, '\0');
    m_szFieldManager[9] = new StrFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[10] = new StrFieldManager(8, FIXED, RIGHT, '\0');
    m_szFieldManager[11] = new BcdFieldManager(6, FIXED, RIGHT, '\0');
    m_szFieldManager[12] = new BcdFieldManager(6, FIXED, RIGHT, '\0');
    m_szFieldManager[13] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[14] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[15] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[16] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[17] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[18] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[19] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[20] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[21] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[22] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[23] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[24] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[25] = new BcdFieldManager(2, FIXED, RIGHT, '\0');
    m_szFieldManager[26] = new BcdFieldManager(2, FIXED, RIGHT, '\0');
    m_szFieldManager[27] = new BcdFieldManager(1, FIXED, RIGHT, '\0');
    m_szFieldManager[28] = new BcdFieldManager(1, FIXED, RIGHT, '\0');
    m_szFieldManager[29] = new BcdFieldManager(8, FIXED, RIGHT, '\0');
    m_szFieldManager[30] = new BcdFieldManager(8, FIXED, RIGHT, '\0');
    m_szFieldManager[31] = new BcdFieldManager(8, FIXED, RIGHT, '\0');
    m_szFieldManager[32] = new BcdFieldManager(11, LLVAR, RIGHT, '\0');
    m_szFieldManager[33] = new BcdFieldManager(11, LLVAR, RIGHT, '\0');
    m_szFieldManager[34] = new StrFieldManager(28, LLVAR, LEFT, '\0');
    m_szFieldManager[35] = new BcdFieldManager(37, LLVAR, LEFT, ' ');
    m_szFieldManager[36] = new BcdFieldManager(104, LLVAR, LEFT, ' ');
    m_szFieldManager[37] = new StrFieldManager(12, FIXED, LEFT, '\0');
    m_szFieldManager[38] = new StrFieldManager(6, FIXED, LEFT, '\0');
    m_szFieldManager[39] = new StrFieldManager(2, FIXED, LEFT, '\0');
    m_szFieldManager[40] = new StrFieldManager(3, FIXED, LEFT, '\0');
    m_szFieldManager[41] = new StrFieldManager(8, FIXED, LEFT, '\0');
    m_szFieldManager[42] = new StrFieldManager(15, FIXED, LEFT, ' ');
    m_szFieldManager[43] = new StrFieldManager(40, FIXED, LEFT, '\0');
    m_szFieldManager[44] = new HexFieldManager(128, LLVAR, LEFT, '\0');
    m_szFieldManager[45] = new StrFieldManager(76, LLVAR, LEFT, '\0');
    m_szFieldManager[46] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[47] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[48] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[49] = new StrFieldManager(3, FIXED, LEFT, '\0');
    m_szFieldManager[50] = new StrFieldManager(3, FIXED, LEFT, '\0');
    m_szFieldManager[51] = new StrFieldManager(3, FIXED, LEFT, '\0');
    m_szFieldManager[52] = new HexFieldManager(8, FIXED, LEFT, '\0');
    m_szFieldManager[53] = new BcdFieldManager(16, FIXED, RIGHT, '\0');
    m_szFieldManager[54] = new StrFieldManager(99, LLVAR, LEFT, '\0');
    m_szFieldManager[55] = new HexFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[56] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[57] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[58] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[59] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[60] = new HexFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[61] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[62] = new StrFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[63] = new HexFieldManager(999, LLLVAR, LEFT, '\0');
    m_szFieldManager[64] = new HexFieldManager(8, FIXED, LEFT, '\0');
    m_szFieldManager[65] = new HexFieldManager(8, FIXED, LEFT, '\0');   //Bitmap externed
    m_szFieldManager[66] = new BcdFieldManager(1, FIXED, RIGHT, '\0');
    m_szFieldManager[67] = new BcdFieldManager(2, FIXED, RIGHT, '\0');
    m_szFieldManager[68] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[69] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[70] = new BcdFieldManager(3, FIXED, RIGHT, '\0');
    m_szFieldManager[71] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[72] = new BcdFieldManager(4, FIXED, RIGHT, '\0');
    m_szFieldManager[73] = new BcdFieldManager(6, FIXED, RIGHT, '\0');
    m_szFieldManager[74] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[75] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[76] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[77] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[78] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[79] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[80] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[81] = new BcdFieldManager(10, FIXED, RIGHT, '\0');
    m_szFieldManager[82] = new BcdFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[83] = new BcdFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[84] = new BcdFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[85] = new BcdFieldManager(12, FIXED, RIGHT, '\0');
    m_szFieldManager[86] = new BcdFieldManager(16, FIXED, RIGHT, '\0');
    m_szFieldManager[87] = new BcdFieldManager(16, FIXED, RIGHT, '\0');
    m_szFieldManager[88] = new BcdFieldManager(16, FIXED, RIGHT, '\0');
    m_szFieldManager[89] = new BcdFieldManager(16, FIXED, RIGHT, '\0');
    m_szFieldManager[90] = new BcdFieldManager(42, FIXED, RIGHT, '\0');
    m_szFieldManager[91] = new StrFieldManager(1, FIXED, LEFT, ' ');
    m_szFieldManager[92] = new StrFieldManager(2, FIXED, LEFT, ' ');
    m_szFieldManager[93] = new StrFieldManager(5, FIXED, LEFT, ' ');
    m_szFieldManager[94] = new StrFieldManager(7, FIXED, LEFT, ' ');
    m_szFieldManager[95] = new StrFieldManager(42, FIXED, LEFT, ' ');
    m_szFieldManager[96] = new HexFieldManager(8, FIXED, LEFT, '\0');
    m_szFieldManager[97] = new BcdFieldManager(16, FIXED, RIGHT, '\0');
    m_szFieldManager[98] = new StrFieldManager(25, FIXED, LEFT, ' ');
    m_szFieldManager[99] = new BcdFieldManager(11, LLVAR, RIGHT, '\0');
    m_szFieldManager[100] = new BcdFieldManager(11, LLVAR, RIGHT, '\0');
    m_szFieldManager[101] = new StrFieldManager(17, LLVAR, LEFT, ' ');
    m_szFieldManager[102] = new StrFieldManager(28, LLVAR, LEFT, ' ');
    m_szFieldManager[103] = new StrFieldManager(28, LLVAR, LEFT, ' ');
    m_szFieldManager[104] = new StrFieldManager(100, LLLVAR, LEFT, ' ');
    m_szFieldManager[105] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[106] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[107] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[108] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[109] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[110] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[111] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[112] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[113] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[114] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[115] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[116] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[117] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[118] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[119] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[120] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[121] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[122] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[123] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[124] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[125] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[126] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[127] = new StrFieldManager(999, LLLVAR, LEFT, ' ');
    m_szFieldManager[128] = new HexFieldManager(8, FIXED, LEFT, '\0');

    return true;
}
